var __sp = String.prototype;
__sp.encodeURI =
function () { 
return escape(this).replace(/\*/g, "%2A").replace(/\+/g, "%2B").replace(/-/g, "%2D").replace(/\./g, "%2E").replace(/\//g, "%2F").replace(/@/g, "%40").replace(/_/g, "%5F") };
__sp.encodeHtml = function () {
    return this.replace(/\&/g, "&amp;").replace(/\>/g, "&gt;").replace(/\</g, "&lt;").replace(/\'/g, "&#039;").replace(/\"/g, "&quot;") 
};
window.usingNamespace = function (A) {
    var C = window; if (!(typeof (A) === "string" && A.length != 0))
    { return C } var F = C; var D = A.split("."); for (var B = 0; B < D.length; B++) { var E = D[B]; if (!C[E]) { C[E] = {} } F = C = C[E] } return F
};
usingNamespace("Web.Utils")["String"] = {
    IsNullOrEmpty: function (A) { return !(typeof (A) === "string" && A.length != 0) }, 
    Trim:
function (A) { return A.replace(/^\s+|\s+$/g, "") },
    TrimStart: function (A, C) {
        if ($String.IsNullOrEmpty(C)) { C = "\\s" }
        var B = new RegExp("^" + C + "*", "ig"); return A.replace(B, "")
    },
    TrimEnd: function (A, C) {
        if ($String.IsNullOrEmpty(C)) { C = "\\s" }
        var B = new RegExp(C + "*$", "ig"); return A.replace(B, "")
    },
    Camel: function (A) {
        return A.toLowerCase().replace(/\-([a-z])/g, function (B, C)
        { return "-" + C.toUpperCase() })
    }, Repeat: function (D, C)
    { for (var B = 0, A = new Array(C); B < C; B++) { A[B] = D } return A.join() },
    IsEqual: function (B, A) { if (B == A) { return true } else { return false } },
    IsNotEqual: function (B, A) { if (B == A) { return false } else { return true } },
    MaxLengthKeyUp: function (C, A) { var B = $(C).val(); if (B.length > A) { $(C).val(B.substring(0, A)) } },
    MaxLengthKeyDown: function (B, A) { if ($(B).val().length > A) { return false } return true } 
};
usingNamespace("Web.Utils")["Converter"] = { ToFloat: function (A) { if (!A || (A.length == 0)) { return 0 } return parseFloat(A) } };
usingNamespace("Web.Utils")["Json"] = { ToJson: function (A)
{ try { return JSON.stringify(A) } catch (B) { } return false },
FromJson: function (B) { try { return JSON.parse(B) } catch (A) { return false } } 
};
usingNamespace("Web")["HttpUtility"] = {
    UrlEncode: function (A) {
        return escape(A).replace(/\*/g, "%2A").replace(/\+/g, "%2B").replace(/-/g, "%2D").replace(/\./g, "%2E").replace(/\//g, "%2F").replace(/@/g, "%40").replace(/_/g, "%5F")
    },
    UrlDecode: function (A) { return unescape(A) } 
};
var $Converter = Web.Utils.Converter;
var $String = Web.Utils.String;
var $Json = Web.Utils.Json;
var $WebsiteConfig = ""//Web.Config.WebsiteConfig;
var $CookieConfig = "";// Web.Config.CookieConfig;
var $HttpUtility = Web.HttpUtility;
var $Url = Web.Url; usingNamespace("Web")["Resource"] = { ImageSize: { Small: "small", Medium: "medium", Big: "mpic" },
    GetRootPaths: function (pathName) { return eval("Web.Config.WebsiteConfig.UrlPathMappings." + pathName) }, GetCurrentImageRoot:
  function (E, B) {
      var C = Web.Resource.GetRootPaths(B); if (C.length == 0) { return "" }
      var F = E.lastIndexOf("."); if (F > 0) {
          try {
              var A = parseInt(E.substring(F - 1, F).charCodeAt(0));
              return C[A % C.length]
          } catch (D) { } 
      } return C[0]
  },
  ConvertProductCodeToImagePath: function (B) {
      if ($String.IsNullOrEmpty(B) && B.length < 10) { return "" } B = B.substring(0, 10);
      var A = B.split("-"); if (A.length != 3) { return "" } return A[0] + "/" + A[1] + "/" + B + ".jpg"
  },
  BuildImage: function (A) { return Web.Resource.GetCurrentImageRoot(A, Environment.ResourceRootPathName) + "/Nest/" + A },
  BuildProductImage: function (B, C) {
      var A = Web.Resource.ConvertProductCodeToImagePath(C);
      return Web.Resource.GetCurrentImageRoot(A, Environment.ProductImageRootPathName) + "/" + B + "/" + A
  },
  BuildProductImageV: function (C, E, A) {
      var B = Web.Resource.ConvertProductCodeToImagePath(E);
      var D = Web.Resource.GetCurrentImageRoot(B, Environment.ProductImageRootPathName) + "/" + C + "/" + B;
      if (A == "") { return D } return D + "?v=" + A
  },
  BuildContent: function (name) { return eval("Web.ResourceConfig.StringResourceConfig." + name) },
  BuildContent: function () {
      var args = arguments; var result = eval("Web.ResourceConfig.StringResourceConfig." + arguments[0]);
      for (var i = 1; i < args.length; i++) { var re = new RegExp("\\{" + (i - 1) + "\\}", "gm"); result = result.replace(re, arguments[i]) }
      return result
  }
}; 
var $Resource = Web.Resource; usingNamespace("Web")["QueryString"] = {
    Get: function (B) {
        B = B.toLowerCase(); var A = Web.QueryString.Parse(); var C = A[B];
        return (C != null) ? C : ""
    }, Set: function (B, C) {
        B = B.toLowerCase();
        var A = Web.QueryString.Parse(); A[B] = $HttpUtility.UrlEncode(C); return Web.QueryString.ToString(A)
    },
    Parse: function (A) {
        var G = {}; if (A == null) { A = location.search.substring(1, location.search.length) }
        if (A.length == 0) { return G } A = A.replace(/\+/g, " "); var C = A.split("&"); for (var D = 0; D < C.length; D++) {
            var F = C[D].split("="); var B = F[0].toLowerCase(); var E = (F.length == 2) ? F[1] : B; G[B] = E
        }
        return G
    },
    ToString: function (A) {
        if (A == null) { A = Web.QueryString.Parse() }
        var C = ""; for (var B in A) { if (C == "") { C = "?" } C = C + B + "=" + A[B] + "&" } C = C.substring(0, C.length - 1); return C
    } 
};
var $QueryString = Web.QueryString; usingNamespace("Web")["Form"] = { reset: function (A) { var B = $("#" + A); B.reset() },
    submit: function (A) { var B = $("#" + A); B.submit() } 
}; var MessageType = { Info: "0", Warning: "1", Error: "2" };
usingNamespace("Web.Ajax")["Loading"] = {
    Begin: function (A) { if ($String.IsNullOrEmpty(A)) { A = $Resource.BuildContent("LoadingData") } $("#loading").html(A) },
    End: function () { $("#loading").html("") }
};
